package lxt.dao.impl;

import java.util.ArrayList;
import java.util.List;

import lxt.dao.DriverWorkloadDao;
import lxt.entity.DriverWorkload;

public class DriverWorkloadDaoImpl extends ABseDaoImpl implements
		DriverWorkloadDao {
	/**
	 * 根据订单Id删除数据
	 */
	@SuppressWarnings("unchecked")
	public void deleteOrder(String orderId){
		StringBuffer hql = new StringBuffer(" Select a from DriverWorkload a where a.id.invoiceInfo.id = ? ");
		ArrayList<Object> param = new ArrayList<Object>();
		param.add(orderId);
		List<DriverWorkload> temp = this.getHibernateTemplate().find(hql.toString(),param.toArray());
		for(int i=0;i<temp.size();i++){
			DriverWorkload entity = temp.get(i);
			this.getHibernateTemplate().delete(entity);
		}
	}
}
